package com.naiterui.ehp.bs.b2c.address.controller;

import com.naiterui.ehp.bp.constants.SwaggerTag;
import com.naiterui.ehp.bp.support.exception.PublicService;
import com.naiterui.ehp.bp.support.exception.ResponseVO;
import com.naiterui.ehp.bs.b2c.address.service.ICityService;
import com.naiterui.ehp.bs.b2c.address.vo.CityVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 城市接口
 *
 * @author guoyongxiang
 * @date 2019-01-11 21:34
 * @since 1.0.0
 */
@Api(tags = SwaggerTag.PATIENT + SwaggerTag.ADDRESES)
@RequestMapping("b2c/addreses")
@RestController
public class CityController {

    @Autowired
    private ICityService cityService;

    @ApiOperation(value = "城市列表")
    @GetMapping("citys")
    public ResponseVO<List<CityVO>> cityList() {
        List<CityVO> cityVOList = this.cityService.getAll();
        return PublicService.returnResponseVO(cityVOList);
    }
}
